<#import "macros.ftl" as godt>
<html>
	<head>
		<title>${component.name}</title>
		<link rel="stylesheet" href="../../css/reset.css" />
		<link rel="stylesheet" href="../../css/text.css" />
		<link rel="stylesheet" type="text/css" href="../../css/godt.css" />
		<link rel="stylesheet" href="../../css/960.css" />
		
	</head>
	<body>
		<div class="container_12">
			<div class="grid_12 border_rounded">
				<h1><strong>${component.name}</strong></h1>			
			</div>		
			<div class="clear"></div>
			<div class="grid_12 title">
				<h3><strong>General Properties</strong></h3>
			</div>
			<div class="clear"></div>
			<div class="grid_12 central">
				Type: <em>${component.type}</em><br/>
				Loader: <em>${component.loader}</em><br/>
				Location: <em>${component.location}</em>				
			</div>			
			<div class="clear"></div>
			<#list component.ecas as eca>
				<div class="grid_12 title">
					<a name="${eca.service?default('')}"></a>
					<h3><strong>${eca.service?default('')}</strong></h3>
				</div>
				<div class="clear"></div>
				<div class="grid_12 central">
					Event: <em>${eca.event}</em><br/>
					Run On Failure: <em>${eca.runOnFailure}</em><br/>
					Run On Error: <em>${eca.runOnError}</em>				
				</div>	
				<div class="clear"></div>
				<#if eca.conditions?size gt 0>
					<div class="grid_12 views">
						<table>
							<tr><th colspan="6">Conditions</th></tr>
							<tr>
								<th>Map Name</th>
								<th>Field Name</th>
								<th>Operator</th>
								<th>Value</th>
								<th>Type</th>
								<th>Format</th>
							</tr>
							<#list eca.conditions as condition>
								<tr>
									<td>${condition.mapName}</td>
									<td>${condition.fieldName}</td>
									<td>${condition.operator}</td>
									<td>${condition.value}</td>
									<td>${condition.type}</td>
									<td>${condition.format}</td>									
								</tr>
							</#list>
						</table>
					</div>
					<div class="clear"></div>
				</#if>
				<#if eca.conditionFields?size gt 0>
					<div class="grid_12 views">
						<table>
							<tr><th colspan="7">Condition Fields</th></tr>
							<tr>
								<th>Map Name</th>
								<th>Field Name</th>
								<th>Operator</th>
								<th>Type</th>
								<th>Format</th>
								<th>To Map Name</th>
								<th>To Field Name</th>
							</tr>
							<#list eca.conditionFields as condition>
								<tr>
									<td>${condition.mapName}</td>
									<td>${condition.fieldName}</td>
									<td>${condition.operator}</td>
									<td>${condition.type}</td>
									<td>${condition.format}</td>									
									<td>${condition.toMapName}</td>
									<td>${condition.toFieldName}</td>
								</tr>
							</#list>
						</table>
					</div>
					<div class="clear"></div>
				</#if>
				<#if eca.conditionServices?size gt 0>
					<div class="grid_12 views">
						<strong>Condition Services</strong>
						<ul>
							<#list eca.conditionServices as service>
								<li>${service}</li>
							</#list>
						<ul>
					</div>
					<div class="clear"></div>
				</#if>
				<#if eca.setTypes?size gt 0>
					<div class="grid_12 views">
						<table>
							<tr><th colspan="4">Set</th></tr>
							<tr>
								<th>Field Name</th>
								<th>Env Name</th>
								<th>Value</th>
								<th>Format</th>
							</tr>
							<#list eca.setTypes as condition>
								<tr>
									<td>${condition.fieldName}</td>
									<td>${condition.envName}</td>
									<td>${condition.value}</td>
									<td>${condition.format}</td>																		
								</tr>
							</#list>
						</table>
					</div>
					<div class="clear"></div>
				</#if>
				<#if eca.actions?size gt 0>
					<div class="grid_12 views">
						<table>
							<tr><th colspan="10">Action</th></tr>
							<tr>
								<th>Service</th>
								<th>Mode</th>
								<th>Run As User</th>
								<th>Map Name</th>
								<th>New Transaction</th>
								<th>Result to Context</th>
								<th>Result to Result</th>
								<th>Ignore Failure</th>
								<th>Ignore Error</th>
								<th>Persist</th>
							</tr>
							<#list eca.actions as condition>
								<tr>
									<td>${condition.service}</td>
									<td>${condition.mode}</td>
									<td>${condition.runAsUser}</td>
									<td>${condition.mapName}</td>																		
									<td>${condition.newTransaction}</td>
									<td>${condition.resultToContext}</td>
									<td>${condition.resultToResult}</td>
									<td>${condition.ignoreFailure}</td>
									<td>${condition.ignoreError}</td>
									<td>${condition.persist}</td>
								</tr>
							</#list>
						</table>
					</div>
					<div class="clear"></div>
				</#if>
			</#list>
		</div>
	</body>
</html>